This simulation implements the rejection sampling method. The user inputs a probability distribution p(y)
and the interval over which it is defined. The simulation checks that the distribution is non-negative. If the distribution is ever negative, the simulation returns a warning and does not allow sampling.
Although this method does work on an unnormalised distribution, the simulation can check normalisation of the distribution (if the corresponding check box is checked). However, for distributions defined over very large intervals and/or distributions with unusual behaviour, the results of the integration may be unreliable.